***********************************************************************************
** Stata replication file for Party Identification, Ambivalence, and the Issue of Vaccine Procurement in Taiwan 
** Journal of Asian and African Studies                                                   
** Alex Min-wei Lin and Chung-li Wu                                                          
** June 13, 2022
** All commands run using Stata 15
***********************************************************************************

clear all
* Open Stata data file named "2021merged.dta"
* for example: "C:\Desktop\2021merged.dta"

use "2021merged.dta"
set scheme cleanplots, perm
set more off, permanently
rename wr_1 wf

/*VARIABLES IN DATA****/

* Recode v9m (positive answers to Taiwan government's vaccine procurement efforts)
recode v9m00 (0=0)(1=1)(5/99=.), gen (v9r00)
label variable v9r00 "None"
recode v9m01 (0=0)(1=1)(5/99=.), gen (v9r01)
label variable v9r01 "Purchased enough vaccines for everyone"
recode v9m02 (0=0)(1=1)(5/99=.), gen (v9r02)
label variable v9r02 "Successful development of a domestic vaccine"
recode v9m03 (0=0)(1=1)(5/99=.), gen (v9r03)
label variable v9r03 "Early deployment—i.e., the government placed vaccine orders early "
recode v9m04 (0=0)(1=1)(5/99=.), gen (v9r04)
label variable v9r04 "Allowed many countries to help Taiwan"
recode v9m05 (0=0)(1=1)(5/99=.), gen (v9r05)
label variable v9r05 "Actively assisted private organizations in obtaining vaccines"
recode v9m06 (0=0)(1=1)(5/99=.), gen (v9r06)
label variable v9r06 "Showed great concern for people’s health/lives"
recode v9m07 (0=0)(1=1)(5/99=.), gen (v9r07)
label variable v9r07 "Other responses "

* Recode v10m (negative answers to Taiwan government's vaccine procurement efforts)
recode v10m00 (0=0)(1=1)(5/99=.), gen (v10r00)
label variable v10r00 "None"
recode v10m01 (0=0)(1=1)(5/99=.), gen (v10r01)
label variable v10r01 "Did not purchase enough vaccines"
recode v10m02 (0=0)(1=1)(5/99=.), gen (v10r02)
label variable v10r02 "Acted too slowly in the procurement of vaccines"
recode v10m03 (0=0)(1=1)(5/99=.), gen (v10r03)
label variable v10r03 "Depended too much on foreign vaccine donations"
recode v10m04 (0=0)(1=1)(5/99=.), gen (v10r04)
label variable v10r04 "Hindered private organizations from obtaining vaccines"
recode v10m05 (0=0)(1=1)(5/99=.), gen (v10r05)
label variable v10r05 "Was too reliant on the development of domestic vaccines"
recode v10m06 (0=0)(1=1)(5/99=.), gen (v10r06)
label variable v10r06 "Did not show concern for people’s health/lives"
recode v10m07 (0=0)(1=1)(5/99=.), gen (v10r07)
label variable v10r07 "Other responses"

* Create ambivalence variable
gen vac_pos=v9r01+v9r02+v9r03+v9r04+v9r05+v9r06+v9r07
label variable vac_pos "Sum of positive responses"
gen vac_neg=v10r01+v10r02+v10r03+v10r04+v10r05+v10r06+v10r07
label variable vac_neg "Sum of negative responses"
gen vac_amb=((vac_pos+vac_neg)/2)-abs(vac_pos-vac_neg)
label variable vac_amb "Ambivalence level toward vaccine procurement"

* Create ambivalence level
recode vac_amb (-1.5 -1 -.5=-1)(0=0)(.5/3=1)(else=.), gen (amb_level)
label variable amb_level "Ambivalence level"
label define amb -1 "Univalent" 0 "Indifferent" 1 "Ambivalent"
label values amb_level amb

* Recode v6 (control of the pandemic)
recode v6 (1=4)(2=3)(3=2)(4=1)(5 94 95 97 98=.), gen (covid_control)
label variable covid_control "Satisfaction with the central government's handling of the pandemic"
label define satisfation 4 "Very satisfied" 3 "Satisfied" 2 "Disatisfied" 1 "Very disatisfied"
label values covid_control satisfaction

* Recode v8 (covid subsidy and relief)
recode v8 (1=4)(2=3)(3=2)(4=1)(5 94 95 97 98=.), gen (subsidy)
label variable subsidy "Satisfaction with government's subsidy and relief programs"
label values subsidy satisfaction

* Recode v11 (performance of central government on vaccine procurement
recode v11 (97 98=.), gen (vac_performance)
label variable vac_performance "Performance of the central government regarding vaccine procurement"

* Recode v2 (information from traditional media)
recode v2 (1=4)(2=3)(3=2)(4=1)(5/98=.), gen (trad_media)
label variable trad_media "Receive information from traditional media"
label define freq 4 "Frequently" 3 "Sometimes" 2 "Rarely" 1 "Never"
label values trad_media freq

* Recode v3 (information from online media)
recode v3 (1=4)(2=3)(3=2)(4=1)(5/98=.), gen (online_media)
label variable online_media "Receive information from online media"
label values online_media freq

* Recode v4 (information from political shows)
recode v4 (1=4)(2=3)(3=2)(4=1)(5/98=.), gen (political_shows)
label variable political_shows "Receive information from political shows"
label values political_shows freq

* Recode v5 (information from Internet celebrities)
recode v5 (1=4)(2=3)(3=2)(4=1)(5/98=.), gen (internet_celebs)
label variable internet_celebs "Receive information from Internet celebrities"
label values internet_celebs freq

* Create media use
gen media_use=trad_media+online_media+political_shows+internet_celebs

* Recode tc1 (female)
recode tc1 (2=1)(1=0), gen (female)
label variable female "Gender (female=1)"
label define female 0 "Male" 1 "Female"
label values female female

* Recode v1 (age)
mvdecode v1, mv (97 98)
gen age=110-v1
label variable age "Age"
recode age (20/29=1)(30/39=2)(40/49=3)(50/59=4)(60/max=5), gen (age5)
label variable age5 "Age (by groups)"
label define agegroups 1 "20-29 yrs" 2 "30-39 yrs" 3 "40-49 yrs" 4 "50-59 yrs" 5 "60 and over"
label values age5 agegroups

* Recode v51 (education)
recode v51 (1 2 3 4=1)(5=2)(6 7=3)(8=4)(9 98=.), gen (education)
label variable education "Education"
label define edu 1 "Junior high or below" 2 "High school" 3 "College" 4 "Postgraduate"
label values education edu

* Recode v50 (ethnicity)
recode v50 (1=1)(2=2)(3=3)(4 5 97 98=.), gen (ethnicity)
label variable ethnicity "Ethnicity"
label define ethnicity 1 "Taiwanese Hakka" 2 "Taiwanese Minnan" 3 "Mainlander"
label values ethnicity ethnicity

* Recode v49 (partyid)
recode v49 (1 4 5 6 11=1)(2 3 7 8 9 10 12 =3)(13 14 15 94 95 97=2)(98=.), gen (partyid)
label variable partyid "Party identification"
label define partyid 1 "Pan-Blue" 3 "Pan-Green" 2 "Independent"
label values partyid partyid

* Recode v48 (natl_id)
recode v48 (1=1)(2=2)(3=3)(4 94 95 97 98=.), gen (natl_id)
label variable natl_id "National identity"
label define natl_id 1 "Taiwanese" 3 "Chinese" 2 "Both"
label values natl_id natl_id

* Create political knowledge
recode v40 (1=1) (else=0), gen (v40c)
recode v41 (1=1) (else=0), gen (v41c)
recode v42 (1=1) (else=0), gen (v42c)
gen pol_knowledge = v40c+v41c+v42c
label variable pol_knowledge "Political knowledge"

* Create political efficacy
* Recode v43 (nosay)
* original english: People like me don’t have any say about what the government does.
recode v43 (1=1)(2=2)(3=3)(4=4)(5/98=.), gen (nosay)
label variable nosay "Have no say on government policy"
* Recode v44 (don't care)
* original english: I don't think public officials care much what people like me think.
recode v44 (1=1)(2=2)(3=3)(4=4)(5/98=.), gen (dontcare)
label variable dontcare "Officials don't care much about people like me"
* Recode v45 (complex)
* original english: Sometimes politics and government seem so complicated that a person like me can’t really understand what’s going on
recode v45 (1=1)(2=2)(3=3)(4=4)(5/98=.), gen (complex)
label variable complex "Politics is too complex"
gen pol_efficacy = nosay+dontcare+complex
label variable pol_efficacy "Political efficacy"



*************************
**Main Results, Table 1**
*************************
tab1 v9r00 v9r01 v9r02 v9r03 v9r04 v9r05 v9r06 v9r07


*************************
**Main Results, Table 2**
*************************
tab1 v10r00 v10r01 v10r02 v10r03 v10r04 v10r05 v10r06 v10r07

* Note: Response option "The vaccine procurement process was not transparent" obtained by 
* separately counting them from v10r07--"Other Responses"

*************************
**Main Results, Table 3**
*************************
tab amb_level partyid, col chi


*************************
**Main Results, Table 4**
*************************
est clear
reg vac_performance ib3.partyid c.vac_amb pol_knowledge pol_efficacy covid_control subsidy media_use female age ib4.education ib2.ethnicity ib2.natl_id
est store v1
reg vac_performance ib3.partyid##c.vac_amb pol_knowledge pol_efficacy covid_control subsidy media_use female age ib4.education ib2.ethnicity ib2.natl_id
est store v2
est table v1 v2, star(.001 .01 .05) stats(N ll df_m r2 r2_a aic bic) b(%9.3f) varwidth (30)


**************************
**Main Results, Figure 1**
**************************

reg vac_performance ib3.partyid##c.vac_amb pol_knowledge pol_efficacy covid_control subsidy media_use female age ib4.education ib2.ethnicity ib2.natl_id
margins, at(vac_amb=(-1.5(0.5)3) partyid=(1 2 3)) vsquish
marginsplot, recast(line) recastci(rarea) ci1opts(col(gs13)) ci2opts(col(gs14)) ci3opts(col(gs15)) ylabel(2(2)10) xtitle("Ambivalence score") ytitle("Predicted evaluation of government effort") ///
  plot1opts(lcolor(blue)) plot2opts(lcolor(black)) plot3opts(lcolor(green)) legend(ring(0) pos(6) size(small)) name(margins1, replace)

	
*************************
**Appendix B           **
*************************
sum vac_performance vac_amb partyid pol_knowledge pol_efficacy covid_control subsidy media_use female age education ethnicity natl_id
tab1 partyid education ethnicity natl_id

